
export function getCategory(params) {
	return new Promise(function(resolve, reject) {
		const {dbName} = params
		uniCloud.callFunction({
			name: 'getCategoryList',
			data: {
				dbName
			},
			success(res) {
				console.log(res)
				resolve(res.result)
			},
			fail(err) {
				reject(err)
			},
			complete() {}
		});
	})
}
export function getList(params) {
	return new Promise(function(resolve, reject) {
		const {index, cat_id, dbName} = params
		uniCloud.callFunction({
			name: 'getList',
			data: {
				dbName, //要查询的表名
				filter: {
					'category':cat_id
				}, //筛选条件，格式{sex:'女'}
				pageIndex: index, //第几页
				pageSize: 10 //每页的记录条数
			},
			success(res) {
				resolve(res.result.data)
			},
			fail(err) {
				reject(err)
			},
			complete() {}
		});
	})
}